
/*

DEPENDENCIES:
-------------
(none)
-------------


IN THIS FILE:
-------------
ext.get_ancestor
-------------

*/

Gimme.ext.get_ancestor = function(_distance, n)
{
	var elem = this[n || 0];
	var i = _distance;
	while (i-- > 0)
	{
		if (elem)
		{
			elem = elem.parentNode;
		}
		else
		{
			break;
		}			
	}
	
	return Gimme(elem);
};
//[AltSyntax]Gimme.ext.getAncestor = Gimme.ext.get_ancestor;